from datetime import datetime
from database import db

class BaseModel(db.Model):
    """基础模型类，包含共用字段"""
    __abstract__ = True

    created_at = db.Column(db.DateTime, default=datetime.utcnow)
    updated_at = db.Column(db.DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
    is_deleted = db.Column(db.Boolean, default=False)  # 软删除字段